﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace TestLogin
{
	public partial class DivingLogin : Form
	{
		public DivingLogin()
		{
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e)
		{

		}

		private void textBox1_TextChanged(object sender, EventArgs e)
		{

		}

		private void LoginBT_Click(object sender, EventArgs e)
		{
			DBHandler db = new DBHandler();
			this.AccessLevelTB.Text = db.login(this.UserTB.Text,this.PassTB.Text).ToString();
			switch(int.Parse(this.AccessLevelTB.Text))
			{
				case(1):
				{
					
					break;
				}
			}
		}

		

		//TODO rename ConnectDB 
		private void ConnectDB_Click(object sender, EventArgs e)
		{
			DBHandler db = new DBHandler();
			db.addAccount(this.UserTB.Text, this.PassTB.Text, int.Parse(this.AccessLevelTB.Text));
		}

		private void CleanseBT_Click(object sender, EventArgs e)
		{
			DBHandler db = new DBHandler();
			db.cleanse();
		}

	}
}
